<%

// include file for survey specific functions

function getSurveyDescription(surveyName)
{
	var objXML = Application("surveyData");
	var docElem = objXML.documentElement;
	srvName = new String(surveyName);
	var sNode = docElem.selectSingleNode("//survey[@name=\"" + srvName + "\"]");
	objXML = null;
	if(sNode != null)
	{
		return sNode.attributes[1].value;
	}
	else
	{
		return surveyName;	
	}
}

function isWebSurvey(surveyName)
{
	var objXML = Application("surveyData");
	var docElem = objXML.documentElement;
	srvName = new String(surveyName);
	var sNode = docElem.selectSingleNode("//survey[@name=\"" + srvName + "\" && @isWebSurvey=\"1\"]");
	Out("sNode: " + sNode);
	return sNode != null;
}

function getAllSurveys()
{
	var objXML = Application("surveyData");
	var docElem = objXML.documentElement;
	var allSurveys = docElem.selectNodes("//survey");
	var returnString = new String("");
	for(var surveyIndex = 0; surveyIndex < allSurveys.length; surveyIndex++)
	{
		returnString += allSurveys[surveyIndex].attributes[0].value + ",";
	}
	if(returnString.length != 0)
	{
		returnString = returnString.substring(0, returnString.length-1);
	}
	return returnString;	
}


%>